home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15401 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  37 lines

  1. Path: sun001.spd.dsccc.com!jmccarty
  2. From: jmccarty@sun1307.spd.dsccc.com (Mike McCarty)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Small problem with C...
  5. Date: 18 Apr 1996 20:33:18 GMT
  6. Organization: DSC Communications Corporation
  7. Message-ID: <4l68ue$e7l@sun001.spd.dsccc.com>
  8. References: <4ko44f$jf2@venus.compulink.gr> <3172F91C.41C6@gi.alaska.edu> <3172FA76.794B@gi.alaska.edu>
  9. NNTP-Posting-Host: sun1307.spd.dsccc.com
  10.  
  11. In article <3172FA76.794B@gi.alaska.edu>,
  12. Jason Wynne Parsons  <jason@gi.alaska.edu> wrote:
  13. )One correction,  the line which includes:
  14. )
  15. )rand()%6 + 1;
  16. )
  17. )should be:
  18. )
  19. )rand()%5 + 1;
  20. )
  21. )sorry,
  22. )
  23. )Jason
  24.  
  25.  
  26. Please note that you are extracting the -low order- bits from the
  27. pseudo-random sequences. This is a -poor- way to do what you want. The
  28. usual pseudo-random generators create bit patterns where the more
  29. significant bits are -much- better than the low-order bits.
  30.  
  31. Mike
  32. -- 
  33. ----
  34. char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
  35.  
  36. I don't speak for DSC.         <- They make me say that.
  37.